<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>article</title>
</head>
<body>
<form method="post">
    {{ form.csrf_token() }}
    {{ form.cate.label }}{{ form.cate }}<br>
    {{ form.site.label }}{{ form.site }}<br>
    {{ form.url.label }}{{ form.url }}<br>
    {{ form.body.label }}{{ form.body }}<br>
    {{ form.submit }}<br>
    {% for message in get_flashed_messages() %}
        {{ message }}
    {% endfor %}
</form>
{{ ckeditor.load() }}
{{ ckeditor.config(name='body') }}

<hr>
<ul>
{# 循环作者 #}
{% for cate in cates %}
        <li>{{ cate.name }}&nbsp;&nbsp;<a href="{{ url_for('delete_cate',cate_id=cate.id) }}">删除</a></li>
        <ul>
        {# 循环书籍 #}
            {% for site in cate.sites %}
                <li><a href="{{ site.url }}" target="_blank">{{ site.name }}</a>&nbsp;&nbsp;<a href="{{ url_for('delete_site',site_id=site.id) }}">删除</a></li>
            {% else %}
                <li>无</li>
            {% endfor %}
        </ul>
{% endfor %}

</ul>

{{ form.body.data|safe }}
</body>
</html>